//Main.java  
//
//Copyright (C) 2008 Devon Mizelle  
//  
//This program is distributed in the hope that it will be useful,  
//but WITHOUT ANY WARRANTY; without even the implied warranty of  
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
//GNU General Public License for more details.  
//  
//You should have received a copy of the GNU General Public License  
//along with this program.  If not, see <http://www.gnu.org/licenses/>.

package hermes;
import java.util.Scanner;


/**
 *
 * @author Devon Mizelle
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    static Scanner rdr = null;
    public static void main(String[] args) {
       try{
           if(args[0].equals("server")){
               rdr = new Scanner(System.in);
               
                new Server(Integer.parseInt(args[1]));
                System.out.println("Press enter to kill...");
                rdr.nextLine();
                System.exit(0);
            }
        }
       catch(ArrayIndexOutOfBoundsException e){
//           System.err.println("java Main mode");
//           System.err.println("Ex:  java Main server portnumber.");
//           System.err.println("     java Main client hostname portnumber."); 
           new hermes.ClientGUI();
       }
    }

}
